$(function(){
    var oWinTop;
    var oBoxH = $(".box").height();
    var vLen = 0;
    var vIndex = [];
    $(".slidecount li").each(function(){
        vLen = vLen + 1;
        vIndex.push($(this).index());
    });
    $(window).scroll(function(){
        oWinTop = $(window).scrollTop();
        if(oWinTop >= 0 && oWinTop < oBoxH){
            $(".slidecount li:eq("+vIndex[0]+")").addClass("focus").siblings("li").removeClass("focus");
        }else if(oWinTop >= oBoxH && oWinTop < (oBoxH * vIndex[2])){
            $(".slidecount li:eq("+vIndex[1]+")").addClass("focus").siblings("li").removeClass("focus");
        }else if(oWinTop >= oBoxH && oWinTop < (oBoxH * vIndex[3])){
            $(".slidecount li:eq("+vIndex[2]+")").addClass("focus").siblings("li").removeClass("focus");
        }else if(oWinTop >= oBoxH && oWinTop < (oBoxH * vIndex[4])){
            $(".slidecount li:eq("+vIndex[3]+")").addClass("focus").siblings("li").removeClass("focus");
        }else{
            $(".slidecount li:eq("+vIndex[4]+")").addClass("focus").siblings("li").removeClass("focus");
        }
    });
    $(".slidecount li").click(function(){
        if($(this).index() == 0){
            $("body").animate({
                scrollTop:0
            },2000);
            return false;
        }else if($(this).index() == 1){
            $("body").animate({
                scrollTop:$("#n2").offset().top
            },2000);
            return false;
        }else if($(this).index() == 2){
            $("body").animate({
                scrollTop:$("#n3").offset().top
            },2000);
            return false;
        }else if($(this).index() == 3){
            $("body").animate({
                scrollTop:$("#n4").offset().top
            },2000);
            return false;
        }else if($(this).index() == 4){
            $("body").animate({
                scrollTop:$("#n5").offset().top
            },2000);
            return false;
        }
    });
});

var main =document.getElementById("main");
var navPage =document.getElementById("navPage");
function navClick(){
    navPage.style.webkitTransform ="translateX(1420px)";
    navPage.style.opacity = "0.7";
    document.body.style.overflowY = "hidden";
    navPage.style.webkitTransition = "all 0.1s linear forwards";
}
function navClose(){

    navPage.style.webkitTransform ="translateX(-1349px)";

}
document.body.style.overflowY = "hidden";